package action;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import pojo.Student;

import java.sql.Date;

/**
 * Created by sahngjun on 2017-5-8.
 */
@Controller
@RequestMapping("/stu")
public class StudentAction {
    @RequestMapping("/editStudent")
    public String editStudent(Model model) throws Exception {
        Student student = new Student();
        student.setId("s001");
        student.setName("张三");
        student.setAge(32);
        student.setBirthDay(new java.util.Date());
        return "webapp/editStudent";
    }

    @RequestMapping("/editStudengSubmit")
    public String editStudengSubmit(Student student) throws Exception {
        System.out.println(student);
        return "success";
    }


}
